//import 'package:flutter/material.dart';
import 'package:jm_flutter/jm_flutter.dart';
import 'package:fluent_ui/fluent_ui.dart';

import '../../common/common.dart';
import '../resources/colors.dart';

class MyText extends Text {
  // final double size;
  // final Color? color;
  // final FontWeight weight;

  MyText(
    String data, {
    Key? key,
    double? size,
    Color? color,
    FontWeight? weight,
    TextAlign? textAlign,
    bool? i18n,
    double? textScaleFactor,
    double? letterSpacing,
    int? maxLines,
    TextOverflow? overflow,
  }) : super(
          (i18n ?? JmConfig.i18nEnable ? data.i18n : data),
          key: key,
          style: TextStyle(
              fontSize: size ?? JmConfig.defTextStyle.fontSize,
              color: color ?? JmConfig.defTextStyle.color,
              fontWeight: weight,
              letterSpacing: letterSpacing),
          textAlign: textAlign,
          textScaleFactor: textScaleFactor,
          maxLines: maxLines,
          overflow: overflow,
        );

  factory MyText.sub(
    String data, {
    Key? key,
    double? size,
    Color? color,
    FontWeight? weight,
    TextAlign? textAlign,
    bool? i18n,
    double? textScaleFactor,
    double? letterSpacing,
    int? maxLines,
    TextOverflow? overflow,
  }) {
    return MyText(
      data,
      key: key,
      size: size,
      color: color ?? JmConfig.sbuTextStyle.color,
      weight: weight,
      textAlign: textAlign,
      i18n: i18n,
      textScaleFactor: textScaleFactor,
      letterSpacing: letterSpacing,
      maxLines: maxLines,
      overflow: overflow,
    );
  }
}
